#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define debug(x) cerr<<#x<<':'<<x<<endl
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
int T;
int n;
void solve(){
    int l=1,r=2100000000,res=-1;
    while(l<=r){
        int mid=(l+r)>>1;
        int mx=(1+mid)*mid/2;
        int lt=mid/2,rt=mid-lt;
        int mi=(1+lt)*lt/2+(1+rt)*rt/2;
        if(mx-mi>=n) r=mid-1,res=mid;
        else l=mid+1;
    }
    res++;
    // if(n%2==0) if(res%2==1) res++;
    if(n%2==1) if(res%2==0) res++;
    cout<<res<<endl;
}
signed main(){
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
    IOS;
    cin>>T;
    while(T--){
        cin>>n;
        solve();
    }
    return 0;
}
